var tableRanking = {
    url : '',
    leagueId: 0,
    seasonId: 0,
    data:{
        leagues:[],
        seasons:[]
    },
    init: function(options){
        this.url = options.url;
        this.leagueId = options.leagueId;
        this.seasonId = options.seasonId;
        this.data = options.data;
    },
    changeTable: function(leagueId, seasonId){
        var newLink = this.url + '/bang-xep-hang/';
        newLink += this.data.leagues[leagueId];
        if(typeof seasonId != 'undefined')
            newLink += '-' + this.data.seasons[seasonId];
        newLink += '-' + leagueId;
        if(typeof seasonId != 'undefined')
            newLink += '-' + seasonId;
        else
            newLink += '-' + 0;
        newLink += '.html';
        window.location.href = newLink;
    }
}